package ru.urfc.portal.ui.client.renderers;

import ru.urfc.portal.ui.client.descriptor.CompositeGridField;

import com.extjs.gxt.ui.client.data.ModelData;
import com.google.gwt.dom.client.Element;

public class UserNameRenderer extends CompositeRenderer {

	public UserNameRenderer(CompositeGridField field, Element element) {
		super(field, element);
	}	
	
	@Override
	public String render(ModelData modelData) {
		init("", "|", "");
		String result = super.render(modelData);
		return result.startsWith("|||")? result.replace("|||", ""): 
			result.replaceAll("\\|[^\\|]*$", "").replaceAll("\\|+", " ");
	}

}
